<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
        <title>卷式电费发票管理系统</title>
        <link rel="icon" href="favicon.ico" type="image/x-icon" />
        <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
        <meta http-equiv="pragma" content="no-cache">
        <meta http-equiv="cache-control" content="no-cache">
        <link rel="stylesheet" type="text/css" href="common/css/login.css">
        <script type="text/javascript" src="common/js/jquery-1.9.1.js"></script>
        <script type="text/javascript" src="common/js/base64.js"></script>
		<script type="text/javascript">
            //设置全局ajax不缓存数据
            $.ajaxSetup({cache:false});
			var subbtn=false;
            function login(){
				if(subbtn==true){return;};
                var loginname=$('#loginname').val();
                var loginpwd=$('#loginpwd').val();
                if (loginname==''){
                    $('#errmsg').text('请输入用户名');
                    return;
                }
                if (loginpwd==''){
                    $('#errmsg').text('请输入密码');
                    return;
                }
                $('#errmsg').text('正在发送登录请求,请稍候...');
				$('#loginbtn').addClass('loginbtnclose');
				$('#loginbtn').text('正在登录中...');
				$('#loginname').attr("readonly", true);
				$('#loginpwd').attr("readonly", true);
				subbtn=true;
                $('form').submit();
            }
            
            //获取url地址参数
            function getUrlParam(){
                var url=location.search;//获取url
                var urlparam='';
                if (url.indexOf('?')!=-1){
                    urlparam=url.substr(1);
                }
                return urlparam;
            }
            $(function(){
                    var urlparam64=getUrlParam();
                    if (urlparam64!=''){
                        var base64=new Base64();
                        $('#errmsg').text(base64.decode(urlparam64));
                    }
					$("#loginname").focus();
					$('#loginname').bind('keypress',function(event){
						if(event.keyCode == "13")    
						{
							$("#loginpwd").focus();
						}
					});
					$('#loginpwd').bind('keypress',function(event){
						if(event.keyCode == "13")    
						{
							login();
						}
					});
            });
        
        </script>
  </head>
  
  <body>
  		<div class="topspace"></div>
        <div class="toplogo">
        	<span>卷式电费发票管理系统</span>
            <em>Volume Electricity Invoice Management System</em>
        </div>
        <div class="loginbg">
        	<div class="loginbgimg">
            	<div class="loginformbg">
                    <div class="loginform">
                        <div class="loginhead"><span>用户登录</span></div>
                        <div id="errmsg" class="loginerrmsg"></div>
                        <form action="LoginAction!login.action">
                            <div class="loginrow">
                                    <span>用户名</span>
                                    <input type="text" id="loginname" name="loginname" />
                            </div>
                            <div class="loginrow">
                                    <span>密码</span>
                                    <input type="password" id="loginpwd" name="loginpwd"  />
                            </div>
                            <div class="loginrow">
                                    <a id="loginbtn" class="loginbtn" href="javascript:void(0);" onClick="login()">登&nbsp;&nbsp;&nbsp;&nbsp;录</a>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
  </body>
</html>
